package com.o2o.base;

import javax.annotation.Resource;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTablePool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;

public abstract class BaseRepository {
	protected Logger logger = LoggerFactory.getLogger(this.getClass());
	
	protected static Configuration configuration = null;
	
	protected final static String COLENDCHAR = String.valueOf(KeyValue.COLUMN_FAMILY_DELIMITER);// ":" 列簇和列之间的分隔符  
	
	HTablePool pool = new HTablePool(configuration,1000);
//	protected static HBaseConfiguration conf;  
	protected static HBaseAdmin admin; 
//	static{
//		configuration = HBaseConfiguration.create();
//		try {
//			admin = new HBaseAdmin(configuration);
//		} catch (Exception e) {
//			e.printStackTrace();
//		} 
////		configuration = HBaseConfiguration.create();
////		configuration.set("hbase.master", "192.168.0.201:60000");
////		configuration.set("hbase.zookeeper.quorum", "192.168.0.201,192.168.0.202,192.168.0.203");
////		configuration.set("hbase.zookeeper.property.clientPort", "2181");
//	}
	
	@Resource
	protected
	SimpleJdbcTemplate simpleJdbcTemplate;
	
	@Resource
	protected
	JdbcTemplate jdbcTemplate;
	

	
  
}
